


        var selectedInd = 0;
        var adviceInd = 0;

        var tipSwiper = new Swiper('.tipSwiper',{
            loop:true,
        })


        $(document).ready(function(){
            $('main .selected .btn').click(function(){
                var length = $('main .selected .list .item').length;
                $('main .selected .list .item').removeClass('active');
                if($(this)[0].className.indexOf('prev') >= 0){
                    if(selectedInd == 0){
                        selectedInd = length - 1;
                    }else{
                        selectedInd--;
                    }
                }else{
                    if(selectedInd == length - 1){
                        selectedInd = 0;
                    }else{
                        selectedInd++;
                    }
                }
                $('main .selected .list .item').eq(selectedInd).addClass('active');
            })

            $('main .advice .swiper .pagination p').click(function(){
                adviceInd = $(this).index();
                $('main .advice .swiper li').removeClass('active');
                $('main .advice .swiper li').eq(adviceInd).addClass('active');
                $('main .advice .swiper .pagination p').removeClass('active');
                $('main .advice .swiper .pagination p').eq(adviceInd).addClass('active');
            })
            $('main .advice .swiper .btn').click(function(){
                var length = $('main .advice .swiper .pagination p').length;
                if($(this)[0].className.indexOf('prev') >= 0){
                    if(!adviceInd){
                        adviceInd = length - 1;
                    }else{
                        adviceInd--;
                    }
                }else{
                    if(adviceInd == length - 1){
                        adviceInd = 0;
                    }else{
                        adviceInd++;
                    }
                }
                $('main .advice .swiper li').removeClass('active');
                $('main .advice .swiper li').eq(adviceInd).addClass('active');
                $('main .advice .swiper .pagination p').removeClass('active');
                $('main .advice .swiper .pagination p').eq(adviceInd).addClass('active');
            })

            $('main .tips .swiper .btn').click(function(){
                if($(this)[0].className.indexOf('prev') >= 0){
                    tipSwiper.slidePrev();
                }else{
                    tipSwiper.slideNext();
                }
            })
        })